package com.trendata.util;

import java.text.SimpleDateFormat;

import org.codehaus.jackson.map.ObjectMapper;

public class JsonUtil  {
	private static final ObjectMapper objectMapper = new ObjectMapper();

	static {
		objectMapper.setSerializationConfig(objectMapper.getSerializationConfig().withDateFormat(
				new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")));
	}

	public static String getJson(Object object) {
		String ret = null;
		try {
			ret = objectMapper.writeValueAsString(object);
		} catch (Exception e) {
		}

		return ret;
	}
}
